﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>เพิ่มโรงควบคุม</title>
</head>
<style>
#header{
  height: 32px;
  margin-right: 20px;
  margin-left: 2px;
}

#header_titile{
  float: left;
}

#main{
  width:800px;
  margin: 0 auto 0 auto;
  border: 1px solid #E5E5E5;
  padding: 26px 24px 46px;
}

#user_info{
  float: right;
  font-size: 14px;
  /*line-height: 26px;*/
  height: 25px;
  position: relative;
/*  z-index: 49; */
  border-style: solid;
  border-width: 0;
  /* margin-top: 3px; */
  padding: 0 2px 0 6px;
  display:block;
}

body{
  font-family:tahoma;
  font-size:14px; 
}
</style>
<body>
<div id="main">
<div id="header" >แก้ไขข้อมูลอัตราการไหลของน้ำ<div id="user_info">สวัสดีคุณผู้ใช้ <?php echo $_SESSION['username']; ?> <?php echo " (".$_SESSION['user_level'].")"; ?> <a href="<?php echo site_url('webadmin/logout') ?>">ออกจากระบบ</a></div>
    </div>
<br />

<?php 
  echo form_open("plant/update_flow/".$pid."/".$yid."/".$date);

  $inputDisabled = "";
  $bool = ($_SESSION['user_level'] != "reader");
  if ($bool == TRUE)
  {
    echo "<input type='submit' name='btsubmit' value='แก้ไข' /> ";
  }
  else
  {
    $inputDisabled = " disabled='disabled' ";
  }
  echo "<a href=".site_url('plant/plant_edit/'.$pid)." >ยกเลิก</a>";
?>
<table border="1" cellspacing="0" >
  <tr>
    <th rowspan="2" width="90">ดัชนี</th>
    <th colspan="2"><?php echo $str_month; ?> <?php echo $str_year; ?></th>
  </tr>
  <tr>
    <th>ก่อนเข้าระบบ</th>
    <th>ผ่านการบำบัด</th>
  </tr>
  <?php
    if (count($rs) == 0)
    {
      echo "<tr>";
      echo "<td class='alt'>N/A</td>";
      echo "<td class='alt'>N/A</td>";
      echo "<td class='alt'>N/A</td>";
      echo "<tr>";
    }
    else
    {
      foreach ($rs as $row)
      {
        echo "<tr>";
        echo "<td class='alt'>".$row->date."</td>";
        echo "<td class='alt'><input ".$inputDisabled." name='input[]' type='text' value='".$row->flow_in."' size='20' maxlength='15' /></td>";
        echo "<td class='alt'><input ".$inputDisabled." name='output[]' type='text' value='".$row->flow_out."' size='20' maxlength='15' /></td>";
        echo "<tr>";
      }
    }
  ?>

</table>

<br />
<?php
  if ($bool == TRUE)
  {
    echo "<input type='submit' name='btsubmit' value='แก้ไข' /> ";
  }
  echo "<a href=".site_url('plant/plant_edit/'.$pid)." >ยกเลิก</a>";

  echo form_close();

  echo "<font color='error'>";
  echo $err_msg;
  echo "</font>";
?>
</div>
</body>
</html>
